<!-- 改为jsp后 如有需要可按照以下方式include file  -->
<!--<%@include file="Inc/SysProduct.jsp"%> -->

<!-- <%
UserName=session("UserName")			'登陆用户id
Receiver=request.form("Receiver")			'必填字段
Sex=request.form("Sex")			'
Phone=request.form("Phone")		'必填字段
Add=request.form("Add")	'必填字段
Notes=request.form("Notes")			
Email=request.form("Email")			
Subject=request.form("Subject")
CompanyName=request.form("CompanyName")			
Fax=request.form("Fax")		
if UserName="" then 
    UserName="游客" 
end if
if Add="" then
	Add=null
end if
if Fax="" then
	Fax=null
end if


'判断购物车是否为空
ProductList = Session("ProductList")
if productlist="" then
 response.redirect "error.html?error=007"
 response.end
else
  sql_product="select * from Product where Product_Id in ("&productlist&") order by Product_Id"
  Set rs_order = conn.Execute(sql_product)
end if

BranchID="0022"
CoNo="000040"

'交易日期，格式：YYYYMMDD
yy=right(year(date),2)
mm=right("00"&month(date),2)
dd=right("00"&day(date),2)
riqi=yy & mm & dd

'生成订单号所有所需元素,格式为：小时，分钟，秒
xiaoshi=right("00"&hour(time),2)
fenzhong=right("00"&minute(time),2)
miao=right("00"&second(time),2)

'产生外部和内部定单号
BillNo=xiaoshi & fenzhong & miao
inBillNo=yy & mm & dd & "-" & xiaoshi & fenzhong & miao

Set rsadd=server.createobject("adodb.recordset")
rsadd.Open "select * from OrderList" ,conn,1,3
Set rsdetail=server.createobject("adodb.recordset")
rsdetail.Open "select * from OrderDetail" ,conn,1,3

'事务定义开始
'conn.Begintrans

'操作之一开始写入订单列表信息
rsadd.AddNew 
rsadd("UserName")=UserName
rsadd("OrderNum")=inBillNo
rsadd("Receiver")=Receiver
rsadd("Sex")=Sex
rsadd("Phone")=Phone
rsadd("Add")=Add
rsadd("RecTime")=now()
if Subject<>"" then rsadd("Subject")=Subject
if Email<>"" then rsadd("Email")=Email
if CompanyName<>"" then rsadd("CompanyName")=CompanyName
if Fax<>"" then rsadd("Fax")=Fax
if Notes<>"" then rsadd("Notes")=Notes
if error>0 then
	response.write " 操作订单列表生成错误！！"
    return
end if
rsadd("Flag")="No"
rsadd.Update


While Not rs_order.EOF '把购买的产品资料读出来，写入定单详细资料表中

 rsdetail.AddNew 
 rsdetail("UserName")=UserName		'下单用户号
 rsdetail("OrderNum")=inBillNo		'订单号码
 rsdetail("Product_Id")=rs_order("Product_Id")		'产品编码
 rsdetail("OrderTime")=date()

 IF ERROR>0 THEN
	response.write "操作订单详细信息表生成错误！！"
	RETURN
 END if
 rsdetail.Update
 rs_order.MoveNext
Wend
'事务操作结束
'conn.CommitTrans

rsdetail.close
set rsdetail=nothing
rsadd.close
set rsadd=nothing
rs_order.close
set rs_order=nothing
Session("ProductList") =""
%> -->
<style type="text/css">
<!--
.style1 {color: #6F6F6F}
-->
</style>
<style type="text/css">
<!--
.style2 {color: #CC0000}
-->
</style>

<!-- 改为jsp后 解开注释include file  -->
<!--<%@include file="Head.jsp"%>-->

<html>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=1002 align=center border=0>
  <TBODY>
    <TR>
      <TD vAlign=top width=210><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR>
              <TD><IMG height=40 src="imgbly/lt14.gif" width=210></TD>
            </TR>
            <TR>
              <TD align=middle><TABLE width=180 border=0 align="center" cellPadding=0 
            cellSpacing=0 
            style="BORDER-RIGHT: #e9e9e9 1px solid; BORDER-TOP: #e9e9e9 1px solid; BORDER-LEFT: #e9e9e9 1px solid; BORDER-BOTTOM: #e9e9e9 1px solid">
                  <TBODY>
                    <TR>
                      <TD><TABLE cellSpacing=0 cellPadding=0 width=180 
                  border=0>
                          <TBODY>
                            <TR>
                              <TD width="22" align="right">&nbsp;</TD>
                              <TD width="158"><!-- <% call ShowSmallClass_Tree() %> --></TD>
                            </TR>
                          </TBODY>
                      </TABLE></TD>
                    </TR>
                  </TBODY>
              </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE>
          <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
            <TBODY>
              <TR>
                <TD><IMG height=38 src="imgbly/tit_sel.gif" width=210></TD>
              </TR>
              <TR>
                <TD align=middle><table width="180" border=0 align="center" cellpadding=0 
                        cellspacing=1 
                        style="BORDER-RIGHT: #e3e3e3 1px solid; BORDER-TOP: #e3e3e3 1px solid; BORDER-LEFT: #e3e3e3 1px solid; BORDER-BOTTOM: #e3e3e3 1px solid">
                    <tbody>
                      <tr>
                        <td style="PADDING-BOTTOM: 8px; PADDING-TOP: 8px">
                        <form method="Get" name="myform" action="search.html">
                        <table border="0" cellpadding="2" cellspacing="0" align="center">
                              <tr>
                                <td height="28"><input type="text" name="keyword"  style="BORDER-RIGHT: #b7b7b7 1px solid; BORDER-TOP: #b7b7b7 1px solid; BORDER-LEFT: #b7b7b7 1px solid; WIDTH: 120px; BORDER-BOTTOM: #b7b7b7 1px solid" size=12 value="关键字" maxlength="50" onFocus="this.select();">
                                    <input type="submit" name="Submit"  value="搜索">
                                </td>
                              </tr>
                            
                        </table>
                        </form></td>
                      </tr>
                  </table></TD>
              </TR>
            </TABLE>
          <SCRIPT type=text/ecmascript>
function doLogin(fm){
   if(fm.uid.value=='' || fm.uid.value.indexOf("\'")!=-1){
		alert('对不起，用户名不能为空或含有单引号！');
		fm.uid.focus();
		return false;   			
   }
   if(fm.pwd.value==''){
		alert('对不起，密码不能为空！');
		fm.pwd.focus();
		return false;   			
   }

	var postData="Act=doLogin&uid="+escape(fm.uid.value)+"&pwd="+escape(fm.pwd.value);
	var loginAjax=new sc.Ajax("doLogin.html", "GET", postData);
	loginAjax.addEventListener(loginEvent);
	loginAjax.Exec();

	function loginEvent(){
		var a=loginAjax.ajax;
		if(a.readyState==4){ 
			if(a.status==200){
				var rtn=a.responseText;
				if(rtn==1){
					alert('恭喜，您己经登录成功！');
					document.location.reload();
				}else{
					alert('对不起，登录失败！用户名/密码错。');
				}
			}else{
				alert("抱歉，服务器忙，请稍后再试..."+a.statusText );
			}
		}
	}
	return false;
}

function doLogout(){
  var loginAjax=new sc.Ajax('doLogin.html', 'GET', 'Act=doLogout');
  loginAjax.addEventListener(logoutEvent);
  loginAjax.Exec();

	function logoutEvent(){
		var a=loginAjax.ajax;
		if(a.readyState==4){ 
			if(a.status==200){
				var rtn=a.responseText;
				if(rtn==1){
					alert('确定要退出吗！');
					document.location.href=".";
				}else{
					alert('对不起，退出失败！');
				}
			}else{
				alert("抱歉，服务器忙，请稍后再试..."+a.statusText );
			}
		}
	}
}

  </SCRIPT>
          <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
            <TBODY>
              <TR>
                <TD><IMG height=38 src="imgbly/tit_mem.gif" width=211></TD>
              </TR>
              <TR>
                <TD align=middle><TABLE 
            style="BORDER-RIGHT: #e3e3e3 1px solid; BORDER-TOP: #e3e3e3 1px solid; BORDER-LEFT: #e3e3e3 1px solid; BORDER-BOTTOM: #e3e3e3 1px solid" 
            cellSpacing=1 cellPadding=0 width=178 align=center border=0>
                    <TBODY>
                      <TR>
                        <TD align="center" 
                style="PADDING-RIGHT: 5px; PADDING-LEFT: 2px; PADDING-BOTTOM: 5px; PADDING-TOP: 6px"><!-- <% call ShowUserLogin() %> --></TD>
                      </TR>
                  </TABLE></TD>
              </TR>
            </TBODY>
        </TABLE></TD>
      <TD style="BACKGROUND: url(imgbly/bg_body.gif) repeat-y 50% top" vAlign=top><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR>
              <TD><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                  <TBODY>
                    <TR>
                      <TD background=imgbly/bg_rt.gif><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                        <TBODY>
                          <TR>
                            <TD><IMG src="imgbly/rt31.gif" width="209" height=41></TD>
                            <TD>&nbsp;</TD>
                            <TD class=loc 
                      style="BACKGROUND: url(img/bg_rtjiao.gif) no-repeat right 50%; COLOR: #9f9f9f" 
                      align=right>你现在的位置：<A href="index.html">首页</A> &gt; <A href="">产品中心</A> &gt; <span class="title_right">在线订单</span></TD>
                          </TR>
                        </TBODY>
                      </TABLE></TD>
                      <TD width=17>&nbsp;</TD>
                    </TR>
                  </TBODY>
              </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE>
          <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
            <TBODY>
              <TR>
                <TD width=17 height=15>&nbsp;</TD>
                <TD>&nbsp;</TD>
                <TD width=17>&nbsp;</TD>
              </TR>
              <TR>
                <TD>&nbsp;</TD>
                <TD style="LINE-HEIGHT: 24px"><table border="0" cellspacing="1" cellpadding="0" align="center" valign=absmiddle width="100%" bgcolor="#eaeaea">
                  <tr bgcolor="eeeeee">
                    <td height="56" align="center"  bgcolor="eeeeee"><span class="style1">谢谢您，询价提交成功，请您记住您的询价号码，以便查询。</span></td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td width="100%" align="center" valign="middle"><br>
      感谢您咨询我们的产品!<b><br>
      <br>
      </b><span class="style2">您的询价号码是:</span><b><font color="B0266D"><b><!-- <%=inBillNo%> --></b><br>
      <br>
      </font> <br>
    </b></td>
                  </tr>
                </table></TD>
                <TD>&nbsp;</TD>
              </TR>
              <TR>
                <TD height=10>&nbsp;</TD>
                <TD>&nbsp;</TD>
                <TD>&nbsp;</TD>
              </TR>
            </TBODY>
        </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>

<!-- 改为jsp后 解开注释include file  -->
<!--<%@include file="Inc/Foot.jsp"%>-->

</BODY></HTML>
